<?php
	include "../public/commom/config.php";
	include "../public/commom/commom.php";
?>

<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>个人中心</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
		<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
		<link rel="stylesheet" type="text/css" href="public/css/index.css"/>
	</head>

	<body>
		<?php include "public/commom/header.php"; ?>
		
		<table border="1" cellpadding="5">
			<thead>
				<tr>
					<th>用户</th>
					<th>姓名</th>
					<th>电话</th>
					<th>地址</th>
					<th>邮箱</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<?php
						if($_GET) {
							$user_id = $_GET["user_id"];
							
							$sql = "SELECT touch.*, user.username uname FROM touch LEFT JOIN user ON (touch.user_id = user.id) WHERE touch.user_id = '$user_id'";
							
							$result = mysqli_query($conn, $sql);
							
							while($row = mysqli_fetch_assoc($result)) {
								echo "<td>" . $row["uname"] . "</td>
									<td>" . $row["name"] . "</td>
									<td>" . $row["tel"] . "</td>
									<td>" . $row["addr"] . "</td>
									<td>" . $row["email"] . "</td>";
							}
							
							mysqli_close($conn);
							
						}
					?>
				</tr>
			</tbody>
			
		</table>
	</body>

</html>